package com.ruoyi.management.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.management.pojo.po.AmmeterResultPo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface AmmeterResultMapper extends BaseMapper<AmmeterResultPo> {

    @Select("SELECT COUNT(*) FROM dboperate")
    int countAll();

    @Delete("DELETE FROM dboperate ORDER BY created_time ASC LIMIT #{recordsToDelete}")
    void deleteOldestRecords(int recordsToDelete);
}
